package cn.stylefeng.guns.modular.gridsystem.temperature.controller;


import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.stylefeng.guns.core.annotion.BusinessLog;
import cn.stylefeng.guns.core.enums.LogAnnotionOpTypeEnum;
import cn.stylefeng.guns.core.pojo.response.ResponseData;
import cn.stylefeng.guns.core.pojo.response.SuccessResponseData;
import cn.stylefeng.guns.modular.gridsystem.model.param.BizDeviceTemParam;
import cn.stylefeng.guns.modular.gridsystem.temperature.model.param.BizTemperatureRecordParam;
import cn.stylefeng.guns.modular.gridsystem.temperature.service.BizTemperatureRecordService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

/**
 * 开关柜温度 记录温度日志
 *
 * @author
 * @date 2024-06-05
 */
@RestController
public class BizTemperatureRecordController {
    @Autowired
    BizTemperatureRecordService bizTemperatureRecordService;


    /**
     * 分页查询
     *
     * @param param
     * @return
     */
    @GetMapping("/temperature/record/page")
    @BusinessLog(title = "开关柜温度_分页查询", opType = LogAnnotionOpTypeEnum.QUERY)
    public ResponseData page(BizTemperatureRecordParam param) {
        if (ObjectUtil.isEmpty(param.getStationId())) {
           // param.setStationId(0);
        }

        return new SuccessResponseData(bizTemperatureRecordService.pageList(param));
    }

    public static void main(String[] args) {
        String path = "D:\\tmp\\20231124\\xxxxx.jpg";
        String res = StrUtil.subAfter(path, "\\", true);
        System.out.println("res>>>>>>>>>>>>【" + res + "】");
    }
}
